<?php
function db_connect(){
	$server="localhost";
	$username = "root";
	$password="";
	$db = mysql_connect($server,$username,$password);
	mysql_select_db("rapidbook",$db);
	return $db;
}

function db_schuelerdata($query){
	$db=db_connect();
	$result=mysql_query($query,$db);

	$i = 0;

	while ($row=mysql_fetch_assoc($result)){

		$data[$i]["vorname"]= $row["vorname"];
		$data[$i]["name"]= $row["name"];
		$data[$i]["klasse"]= $row["klasse"];
		$data[$i]["schueler_id"]= $row["schueler_id"];
		$i++;
	}
	return $data;
}

?>